﻿
namespace Gmantis.Imaging
{
    internal class ImageResizeFilterTriangle : ImageResizeFilter
    {
        protected override double GetRadius()
        {
            return 1.0;
        }

        protected override double GetWeight(double x)
        {
            if (x < 0.0)
            {
                x = -x;
            }
            if (x < 1.0)
            {
                return (1.0 - x);
            }
            return 0.0;
        }
    }
}
